package com.lbs.droiddoctor.common;

import java.io.IOException;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.util.EntityUtils;


import com.lbs.droiddoctor.constants.AppConstants;

public class HttpRequest {
        
        public static String getResponse(String url) {
        	System.out.println("HttpRequest.getResponse() ");
        	
                HttpGet request= new HttpGet(url);
                try { 
                        HttpResponse  response=AppConstants.HTTP_CLIENT.execute(request);
                        HttpEntity entity = response.getEntity();
                        String respStr = EntityUtils.toString(entity);
                        
                        
                                return respStr;
                                        } catch (ClientProtocolException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IOException e) { 
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                return null;
                
        }

}
